<template>
	<view>
		<u-sticky>
			<view class="mainpadding_top ffffff">
				<view class="searchbox flexleft">
					<u-icon name="search" color="#333" size="20"></u-icon>
					<input type="text" :placeholder="$t('sousuo.qsrspmc')" v-model="keyword" @confirm="init" confirm-type="search"/>
				</view>
			</view>
		</u-sticky>
		<view class="mainpadding2">
			<view class="flexbetween flex_wrap ">
				<view class="spbox margin_top" v-for="item in list"
					@click="jumpdetail('/pages/index/shangpinxq?id=',item.id)">
					<image class="sptp" :src="item.picUrl" mode=""></image>
					<view class="" style="padding: 30rpx 15rpx;">
						<view class="ershiba xiaohei xiankuan textcenter">{{item.name}}</view>
						<view class="strongtext xiaojin textcenter margin_top">￥{{item.counterPrice}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
	
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				list:[],
				keyword:""
			}
		},
		onLoad() {
			this.init()
		},
		methods: {
			init(){
				httpRequest.request('/wx/goods/list', 'GET', {
					keyword: this.keyword,
					page: 1,
					size: 1000
				}).then(res => {
					this.list = res.data.goodsList
				})
			},
		}
	}
</script>

<style>

</style>
